﻿using DevTeam;
using System.Data;

namespace KoliUstu
{
    public partial class KoliUstuHF : DevReport
    {
        public DataSet dsData { get; set; }
        public KoliUstuHF(DataSet dsData, bool isCanada)
        {
            InitializeComponent();

            this.dsData = dsData;

            if (isCanada)
                this.tcShipTo.Text = "Rodair 350 Pendant Drive,\r\nMississauga, ON, L5T 2W6\r\nCANADA"; //Tel: +905-671-4655
            else
                this.tcShipTo.Text = "Strellson AG – Distribution Center,\r\nc/o Meyer & Meyer Logistikzentrum Peine GmbH & Co. KG \r\nMielestrasse 15, D-31275 Lehrte, GERMANY";

            DataRelation FK_Ceki_CekiLines = new DataRelation("FK_Ceki_CekiLines",
               new DataColumn[] {
                   this.dsData.Tables["Table"].Columns["Sayfa"],
                   this.dsData.Tables["Table"].Columns["BoxNr"]},
               new DataColumn[] {
                   this.dsData.Tables["Table1"].Columns["Sayfa"],
              this.dsData.Tables["Table1"].Columns["BoxNr"]});

            this.dsData.Relations.Add(FK_Ceki_CekiLines);

            BindDstoReport();
        }

        void BindDstoReport()
        {
            this.DataMember = "Table";
            this.DataSource = dsData;

            tcSezon.DataBindings.Add("Text", null, "Table.Sezon");
            tcBrand.DataBindings.Add("Text", null, "Table.Brand");
            tcTkz3.DataBindings.Add("Text", null, "Table.TKZNr");
            tcOrderNo.DataBindings.Add("Text", null, "Table.OrderNr");
            tcCartonNo.DataBindings.Add("Text", null, "Table.BoxNr");
            tcOf.DataBindings.Add("Text", null, "Table.BoxTotal");
            tcGrossWeight.DataBindings.Add("Text", null, "Table.GrossWeight");
            tcNetWeight.DataBindings.Add("Text", null, "Table.NetWeight");

            this.DetailReport.DataMember = "Table.FK_Ceki_CekiLines";
            this.DetailReport.DataSource = dsData;

            tcArticle.DataBindings.Add("Text", null, "Table.FK_Ceki_CekiLines.Article");
            tcColor.DataBindings.Add("Text", null, "Table.FK_Ceki_CekiLines.Color");
            tcSize.DataBindings.Add("Text", null, "Table.FK_Ceki_CekiLines.Size");
            tcQuantity.DataBindings.Add("Text", null, "Table.FK_Ceki_CekiLines.Quantity");

        }


    }
}
